#ifndef _SHADOW_RESOURCE_POOL_H_
#define _SHADOW_RESOURCE_POOL_H_

#include <vector>

#include <log4cxx/logger.h>
#include <log4cxx/xml/domconfigurator.h>

#include "Resource.h"
#include "MutexLocker.h"

#define RESOURCE_POOL_RETRY_INTERVAL 1

using std::vector;

class ResourcePool {
		public:
				ResourcePool();
				~ResourcePool();
				int init(int pool_num, int init_res_flag);
				int acquire_resource();
				int release_resource(int index);
				Resource * get_resource_at(int index);
		private:
				vector<Resource> _resources;
				int _last_acquire_resource_index;
				static log4cxx::LoggerPtr _logger;
				pthread_mutex_t _mutex;
};

#endif
